package com.wl4837;

public class App
{
    public static void main( String[] args )
    {
        // 创建处理者
        Approver manager = new Manager();
        Approver director = new Director();
        Approver ceo = new CEO();

        // 构建责任链
        manager.setSuccessor(director);
        director.setSuccessor(ceo);

        // 创建采购请求
        PurchaseRequest request1 = new PurchaseRequest(1001, 4500, "购买办公用品");
        PurchaseRequest request2 = new PurchaseRequest(1002, 8000, "团队建设活动");
        PurchaseRequest request3 = new PurchaseRequest(1003, 150000, "新项目设备采购");

        // 处理请求
        manager.processRequest(request1);
        manager.processRequest(request2);
        manager.processRequest(request3);
    }
}
